var fs = require('fs');

module.exports = {
	readfile:function (path, recall){//异步执行
		fs.readFile(path, function(err, data){
			if(err){
				console.log(err)
			}else{
				recall(data.toString());
				// res.write(data);  //error : write after end
				console.log(data.toString());
			}
		});
		console.log("异步方法执行完毕");
	},
	readFileSync:function (path){
		var data = fs.readFileSync(path, 'utf-8');
		console.log("同步方法执行完毕");
		console.log(data.toString());
		return data;
	}
}